package com.wzy.business.store.me.presenter.impl

import com.wangzhenyu.common.base.BasePreImpl
import com.wangzhenyu.common.netcore.networking.http.core.awaitHiResponse
import com.wangzhenyu.common.util.log.LogUtil
import com.wzy.business.store.me.api.MeRepository
import com.wzy.business.store.me.bean.Article
import com.wzy.business.store.me.presenter.HelpDocPresenter
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class HelpDocPresenterImpl(val view: HelpDocPresenter.View) : BasePreImpl(view),
    HelpDocPresenter {

    override fun queryContentList(page: Int, pageSize: Int) {
        mCoroutine.launch {

            val resp = MeRepository.apiService.getArticle(page, pageSize).awaitHiResponse()
            val data: MutableList<Article.DataX>? = resp.data.data?.datas
            if (data != null) {
                view.loadDataSuccess(data)
            } else {
                view.loadDataFail()
            }
        }
    }


}